package thread.processing.performance;

import java.util.concurrent.TimeUnit;

public class WithoutThread2 {
	static int counter = 0;

	public static void main(String[] args) {

		long startTime = System.nanoTime();

		for (int i = 0; i < 100; i++) {
			Util.doWork();
			counter++;
		}

		long elapsedTime = System.nanoTime() - startTime;
		long seconds = TimeUnit.SECONDS.convert(elapsedTime,
				TimeUnit.NANOSECONDS);
		System.out.println("Time taken : " + seconds + " Seconds");
		System.out.println("Completed Tries : " + counter);
	}
}

//first run
/*
Time taken : 25 Seconds
Completed Tries : 10
*/
